import java.util.Arrays;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        int[][] a = {{1,2,3},{4,5,6}};
        int[][] b = new int[2][3];
        int[][] c = new int[][]{{1, 2, 3}, {4, 5, 6}};
        System.out.println(Arrays.deepToString(a));
        for (int i = 0; i < a.length; i++) {
            for (int j = 0; j < a[i].length; j++) {
                System.out.print(a[i][j]+" ");
            }
            System.out.println();
        }
    }
    public static void my_sort(int[] array){
        for (int i = 0; i < array.length-1; i++) {
            int flg = 0;
            for (int j = 0; j < array.length-1-i; j++) {
                if(array[j]>array[j+1]){
                    flg = -1;
                    int tmp = array[j];
                    array[j] = array[j+1];
                    array[j+1] = tmp;
                }
            }
            if(flg == 0)
                break;
        }
    }
    public static void main4(String[] args) {
        int[] a = {3,2,1,4,9,6,7};
        System.out.println(Arrays.toString(a));
        my_sort(a);
        System.out.println(Arrays.toString(a));
    }
     public static void main3(String[] args) {
        int[] a = {1,9,7,4,80,5};
        int[] b = Arrays.copyOf(a,a.length);
        System.out.println(Arrays.toString(a));
        Arrays.sort(a);
        int ret = Arrays.binarySearch(a,4);//二分查找
        System.out.println(ret+"");
        System.out.println(Arrays.toString(a));
        System.out.println(Arrays.toString(b));
    }
    public static void print(int n) {
        if(n<10)
            System.out.println(n);
        else
        {
            print(n/10);
            System.out.println(n%10);
        }

    }
    public static int print1(int n) {
        if(n<10)
            return n;
        return print1(n/10) + n%10;
    }
    public static void main2(String[] args) {
        System.out.println(print1(1234));
        int[] arr1 = {1,2,3};
        int[] arr2 = new int[10];
        int[] arr3 = new int[]{1,2,3,4,5};
        int ret = arr1.length;
        int a = arr1[2];
        System.out.println("123");

        //增强for循环
        for (int x:arr1) {
            System.out.println(x+" ");
        }

        //将数组转换成字符串 然后返回
        String ret1 = Arrays.toString(arr1);
        System.out.println(ret1);
    }



    public static void main1(String[] args) {
        Scanner sca = new Scanner(System.in);
        while(sca.hasNextInt()){
            int n= sca.nextInt();
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    if(i == j || i + j == n - 1){
                        System.out.print("*");
                    }else{
                        System.out.print(" ");
                    }
                }
                System.out.println();
            }
        }
    }
}
